package com.lesama.regex;

public class RegexTest {
    public static void main(String[] args) {
        String qqRegex = "[1-9]\\d{4,11}";
        System.out.println("1506536196".matches(qqRegex));
        System.out.println("6196".matches(qqRegex));
        System.out.println("06196".matches(qqRegex));

        String telRegex = "[1][3-9]\\d{9}";
        System.out.println("13697976011".matches(telRegex));
        System.out.println("136979760112".matches(telRegex));
        System.out.println("23697976011".matches(telRegex));
        System.out.println("12697976011".matches(telRegex));

        String emailRegex = "\\w+@[\\w&&[^_]]+(\\.[a-z]{2,3})+";
        System.out.println("1506536196@qq.com".matches(emailRegex));
        System.out.println("1506536196@qq.edu.cn".matches(emailRegex));
    }
}
